package flib;


import java.util.Comparator;

public class HEdgeAngleComparator implements Comparator{

	public int compare(Object arg0, Object arg1) {
		FlibHEdge h1=(FlibHEdge)arg0;
		FlibHEdge h2=(FlibHEdge)arg1;
		double angle1=h1.getAngle();
		double angle2=h2.getAngle();
		if (angle1>angle2)return 1;
		if (angle1<angle2)return -1;
		if (h1.getDest().getZ()>h1.getDest().getZ()) return 1;
		if (h1.getDest().getZ()<h1.getDest().getZ()) return -1;
		double l1=h1.getLengthSqr();
		double l2=h2.getLengthSqr();
		if (l1>l2)return 1;
		if (l1<l2)return -1;
		
		// TODO Auto-generated method stub
		return 0;
	}

}
